import React, { Component } from 'react'

export default class Header extends Component {
  constructor (props) {
    super(props);
    this.state = {}
  }
  checked = () => {
    this.props.changeCheckedAll()
  }
  render() {
    return (
      <>
        <thead>
          <tr>
            <th>
              <p style={{ display: 'inline-block' }}>是否选中</p>
              <input type="checkbox" checked={this.props.list.every(item => item.checked)} onChange={() => this.checked()} />
            </th>
            <th>商品序列</th>
            <th>商品名称</th>
            <th>商品价格</th>
            <th>总价</th>
            <th>商品数量</th>
            <th>操作</th></tr>
        </thead>
      </>
    )
  }
}
